<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>ProcessViewerEvent</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>

<body>
<h1>ProcessViewerEvent</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a href="index.html">exported functions</a>
</div>

<div class=shortdescr>
The <dfn>ProcessViewerEvent</dfn> function informs plugins about different internal viewer
events.</div>

<pre class=syntax>
int WINAPI ProcessViewerEvent(
  int Event,
  void *Param
);
</pre>

<h3>Parameters</h3>
<div class=descr>
    <div class=dfn>Event</div>
    <div class=dfndescr>Event type.<br>
      Can be one of the following values (<a name="VIEWER_EVENTS">VIEWER_EVENTS</a> enum):
<table class="cont">
<tr class="cont"><th class="cont" width="40%">Event</th><th class="cont" width="60%">Description</th></tr>
<tr class="cont"><td class="cont" width="40%"><a name="VE_CLOSE" title="1">VE_CLOSE</a></td>
<td class="cont" width="60%">One of the internal viewers is closing. Plugins can use this event to
free internal data structures. Note that several viewers can be active at the same time.
<dfn>Param</dfn> points to an integer variable containing the ViewerID parameter of the viewer
instance being closed. The ViewerID of the current viewer can be obtained earlier using the
<a href="../service_functions/viewercontrol.html#VCTL_GETINFO">VCTL_GETINFO</a>
<a href="../service_functions/viewercontrol.html">ViewerControl</a> command.
But the plugin should not call the ViewerControl function when processing this event, because the viewer is
already closed.<br>
Return value must be 0.
</td></tr>

<tr class="cont"><td class="cont" width="40%"><a name="VE_READ" title="1">VE_READ</a></td>
<td class="cont" width="60%">A new file has just been loaded.<br>
  <i>Param</i> = NULL.<br>
  Return value must be 0.
</td></tr>

 <tr class="cont"><td class="cont" width="40%"><a name="VE_KILLFOCUS">VE_KILLFOCUS</a></td>
 <td class="cont" width="60%">Viewer has lost input focus.<br>
   <i>Param</i> points to a variable containing the ViewerID value of the viewer instance that has lost focus.<br>
   Return value must be 0.
 </td></tr>

 <tr class="cont"><td class="cont" width="40%"><a name="VE_GOTFOCUS">VE_GOTFOCUS</a></td>
 <td class="cont" width="60%">Viewer has got input focus.<br>
   <i>Param</i> points to a variable containing the ViewerID value of the viewer instance that has got focus.<br>
   Return value must be 0.
 </td></tr>

</table>
    </div>
    <div class=dfn>Param</div>
    <div class=dfndescr>
      Points to data dependent on the event type.
    </div>
</div>

<h3>Return value</h3>
<div class=descr>
  Return value depends on the event type.<br>
  Return 0 for unknown event types.
</div>

<h3>Remarks</h3>
<div class=descr>
  <li>VE_READ is called only once for each file.</li>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="../service_functions/viewercontrol.html">ViewerControl</a>
</div>

</body>
</html>
